<template>
  <div class="wallet">
    <!-- 健康钱包头部 -->
    <div class="wallet-head">
      <van-nav-bar
        title="健康钱包"
        right-text="设置"
        left-arrow
        @click-left="onClickLeft"
      />
    </div>
    <!-- 账户余额 -->
    <div class="balance">
      <a>明细</a>
      <div class="balance-text">
        <p>账户余额（元）</p>
        <h1>0.00</h1>
      </div>
    </div>
    <!-- 充值/提现 -->
    <div class="wallet-pay">
      <li class="pay-one">充值</li>
      <li>提现</li>
    </div>
    <!-- 分割线 -->
    <van-divider />
    <!-- 账单/银行卡/红包/代金券 -->
    <div class="wallet-main">
      <van-grid direction="horizontal" :column-num="2">
        <van-grid-item
          v-for="(item, index) in list"
          :key="index"
          :icon="item.imgurl"
          :text="item.name"
        />
      </van-grid>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          name: "账单",
          imgurl: require("../../../assets/mine-font/mine-wallet/bill.png"),
        },
        {
          name: "银行卡",
          imgurl: require("../../../assets/mine-font/mine-wallet/bank-card.png"),
        },
        {
          name: "红包",
          imgurl: require("../../../assets/mine-font/mine-wallet/red-packets.png"),
        },
        {
          name: "代金券",
          imgurl: require("../../../assets/mine-font/mine-wallet/Coupon.png"),
        },
      ],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="less" scoped>
.wallet {
  width: 100%;
  height: 100%;
  background: #f7f7f7;
  position: fixed;
  // 健康钱包头部
  .wallet-head {
    /deep/ .van-nav-bar__title {
      color: #000 !important;
      font-size: 18px;
      font-weight: 900;
    }
    /deep/ .van-nav-bar .van-icon {
      color: #000 !important;
    }
    /deep/ .van-nav-bar__text {
      color: #000 !important;
    }
  }
  // 账户余额
  .balance {
    width: 100%;
    height: 152px;
    background: url("../../../assets/mine-font/mine-wallet/balance.png");
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    a {
      width: 55px;
      height: 24px;
      border-radius: 12px;
      background: #ec653a;
      color: #f9ddd3;
      font-size: 16px;
      display: flex;
      justify-content: center;
      align-items: center;
      text-decoration: none;
      position: absolute;
      right: 11px;
      top: 15px;
    }
    .balance-text {
      width: 150px;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      p {
        margin: 0;
        font-size: 20px;
        font-weight: 500;
        color: #fff;
      }
      h1 {
        font-weight: 500;
        margin: 9px 0 0 0;
        color: #fff;
      }
    }
  }
  // 充值/提现
  .wallet-pay {
    display: flex;
    align-items: center;
    background: #fff;
    li {
      width: 49%;
      height: 24px;
      line-height: 24px;
      margin: 6px 0;
      font-size: 16px;
      color: #333;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: "黑体";
    }
    .pay-one {
      border-right: 1px solid #f7f7f5;
    }
  }
  // 分割线
  .van-divider {
    margin: 0;
    border: 5px solid #f7f7f7;
    background: #f7f7f7;
  }
  // 账单/银行卡/红包/代金券
  .wallet-main {
    /deep/ .van-grid-item__content {
      height: 80px;
    }
    /deep/ .van-grid-item__text {
      font-size: 17px;
      color: #333;
      font-family: "黑体";
    }
  }
}
</style>
